-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Allow only parentheses in #[reflect(...)] #21400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Allow only parentheses in #[reflect(...)] #21400
Conversation
It looks like your PR is a breaking change, but you didn't provide a migration guide. Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes. |
ff47f84
to
e14c76d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix, but I don't think that the migration guide is correct. It should instead focus on communicating that "this didn't work before either, but it led to silent bugs".
@alice-i-cecile I initially forgot to clarify why this pull request focuses only on the syntax, please see the updated pull request description. |
e14c76d
to
8cc80d7
Compare
Objective
Fixes #8906
#8906 reports that the
reflect
attribute silently fails when using the#[reflect[...]]
syntax. I wasn't able to reproduce that issue, so it was likely resolved in a prior change. This pull request addresses only the syntax issue.Solution
Validate the
Meta::List
delimiter in reflect macro to allow onlyMacroDelimiter::Paren
Testing
I run
cargo check --example reflection_types
No
Run
cargo check --example reflection_types
Then modify the reflection_types example by changing:
to
then run
cargo check --example reflection_types
again it should now fail with this error: